package com.fourth.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fourth.vo.CommodityManageVo;
import com.fourth.vo.SearchCommodityVo;
import com.ljx.entity.*;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UBcommodityManagerDao extends BaseMapper<Goods> {

	/**
	 * 初始化查询出所有商品信息
	 * @param goods
	 * @return
	 */
	Page<CommodityManageVo> selectAllGoodsInfoByBusinessId(Page<CommodityManageVo> page,@Param("goods") Goods goods);

	/**
	 * 修改上下架状态
	 * @param goods
	 * @return
	 */
	@Select("update g_goods set status=#{status} where id=#{id}")
	void   updateStatus(Goods goods);

	/**
	 *
	 * 根据id删除商品数据
	 * @param id
	 * @return
	 */

	int    deleteGoodsById(Integer id);

	/**
	 * 查询单位 种类 品牌 储存方式
	 * @return
	 */
	@Select("select * from g_deposit")
	List<Deposit> findAllDeposit();
	@Select("select * from g_brand")
	List<Brand> selectAllBrand();
	@Select("select * from g_unit")
	List<Unit> selectAllUnit();
	@Select("select * from g_sort")
	List<Sort> selectAllSort();



}
